package com.rui.study.algorithm.T_调度任务的取消;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @program: study_20180903
 * @description:
 * @author: Yaowr
 * @create: 2018-10-25 17:18
 **/
public class SimpleThreadFactory implements ThreadFactory {

    private AtomicInteger count = new AtomicInteger();

    public Thread newThread(Runnable r) {
        return new Thread(r, "My-Task-" + count.getAndIncrement());
    }
}
